dhcpv6: remove OAF_TENTATIVE
authorDavid Härdeman <[email protected]>
Sun, 23 Nov 2025 23:32:22 +0000 (00:32 +0100)
committerÁlvaro Fernández Rojas <[email protected]>
Sun, 30 Nov 2025 16:00:21 +0000 (17:00 +0100)
The flag was only set in two places, and never used. Its meaning was
also essentially the inverse of OAF_BOUND.

Signed-off-by: David Härdeman <[email protected]>
Link: https://github.com/openwrt/odhcpd/pull/331
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
src/dhcpv6-ia.c
src/odhcpd.h

index 1b17cf72efcb50fa05571bdd419508e19a7414de..6f3852d2c924621145e9255bbf8e7c4443558ccf 100644 (file)
@@ -1226,12 +1226,9 @@ proceed:
                        ia_response_len = build_ia(buf, buflen, status, ia, a, iface,
                                                        hdr->msg_type == DHCPV6_MSG_REBIND ? false : true);
 
-                       /* Was only a solicitation: mark binding for removal */
+                       /* Was only a solicitation: mark binding for removal in 60 seconds */
                        if (assigned && hdr->msg_type == DHCPV6_MSG_SOLICIT && !rapid_commit) {
                                a->flags &= ~OAF_BOUND;
-                               a->flags |= OAF_TENTATIVE;
-
-                               /* Keep tentative assignment around for 60 seconds */
                                a->valid_until = now + 60;
 
                        } else if (assigned &&
@@ -1248,7 +1245,6 @@ proceed:
                                        }
                                }
                                a->accept_fr_nonce = accept_reconf;
-                               a->flags &= ~OAF_TENTATIVE;
                                a->flags |= OAF_BOUND;
                                apply_lease(a, true);
                        } else if (!assigned) {
index d7a32bb414d3471b0482e1db9d39f2f7194c0831..3fb3acc899ebbbec50c4b445799c92f653e94d89 100644 (file)
@@ -190,10 +190,9 @@ enum odhcpd_mode {
 
 
 enum odhcpd_assignment_flags {
-       OAF_TENTATIVE           = (1 << 0),
-       OAF_BOUND               = (1 << 1),
-       OAF_DHCPV6_NA           = (1 << 2),
-       OAF_DHCPV6_PD           = (1 << 3),
+       OAF_BOUND               = (1 << 0),
+       OAF_DHCPV6_NA           = (1 << 1),
+       OAF_DHCPV6_PD           = (1 << 2),
 };
 
 /* 2-byte type + 128-byte DUID, RFC8415, §11.1 */